package com.yyy.dm.consumer.controller;

import com.yyy.dm.CommonResponse;
import com.yyy.dm.consumer.service.OrderConsumerService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

@RestController
@RequestMapping("/order")
public class OrderConsumerController {

    @Resource
    private OrderConsumerService orderConsumerService;

    //提交订单
    @PostMapping("/permission/submitorder")
    public CommonResponse submitOrder(@RequestBody Map<String,String> map){
        return orderConsumerService.submitOrder(map);
    }
    //查询订单
    @PostMapping("/permission/queryorderlist")
    public CommonResponse queryOrderList(@RequestBody Map<String,String> map){
        return orderConsumerService.queryOrderList(map);
    }
    //根据订单号查询订单
    @PostMapping("/permission/confirmpay")
    public CommonResponse confirmPay(@RequestBody Map<String,String> map){
        return orderConsumerService.confirmPay(map.get("orderNo"));
    }

}
